import request from "../../utils/request";

export function getCouponList(currentPage) {
    return request({
        url: 'admin/coupon/List',
        method: 'get',
        params: {
            page: currentPage
        }
    })
}

export function batchUpdateCoupons(ids) {
    return request({
        url: '/admin/coupon/batchDelete?ids=' + ids,
        method: 'delete'
    })
}

export function getCoupon(id) {
    return request({
        url: '/Coupon/' + id,
        method: 'get',
    })
}

export function updateCoupon(data) {
    return request({
        url: '/admin/coupon/UpCoupon',
        method: 'put',
        data: data
    })
}
export function getCouponDetail(couponId) {
    return request({
        url: '/admin/coupon/GetById',
        method: 'get',
        params: {
            couponId: couponId
        }
    })
}
export function createCoupon(data) {
    return request({
        url: '/admin/coupon/AddCoupon',
        method: 'post',
        data: data
    })
}